<template>
  <div class="edit">
     
          <div >
              <button class="btn" @click="resolveCode">执行</button>
              <button class="btn">清除</button>
          </div>
      <textarea :value="code" rows="30" @input="handleInput"></textarea>

     
  </div>
</template>

<script>
export default {
    // eslint-disable-next-line vue/multi-word-component-names
    name:"edit",
    data(){
        return{
            code:''
        }
    },
    methods:{
        handleInput(e){
            this.code = e.target.value
            // this.$emit('update',e.target.value)
            // this.resolveCode(e.target.value)
        },
        resolveCode(){
            console.log(this.code,'this.code');
            this.$emit('update',this.code)
        }
    }
}
</script>

<style lang="scss" scoped>
.btn{
    padding: 10px 30px;
    margin: 10px 20px;
}
textarea{
    // border: none;
    width: calc(100% - 10px);
    height: 100%;
}

</style> 
